/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * | 公共模板赋值初始化方法
 * +----------------------------------------------------------------------
 */
layui.define(['laytpl'], function (exports) {
    var laytpl = layui.laytpl;
    var templateInit = {
        init: function (viewId, //传入视图承接id
                        data,    //传入相关数据
                        templateHtml //模板引擎代码
        ) {
            var view = document.getElementById(viewId);
            var controller = function () {
                var html = laytpl(templateHtml).render(data);
                view.innerHTML = html;
            };
            controller();
        }
    };
    exports('templateInit', templateInit);
});